home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 November / Chip 11-96.iso / workshop / howto / xfree86 < prev   
Text File  |  1996-09-04  |  45KB  |  1,076 lines

  1.   The Linux XFree86 HOWTO
  2.   by Matt Welsh, mdw@sunsite.unc.edu
  3.   v3.0, 15 March 1995
  4.  
  5.   This document describes how to obtain, install, and configure version
  6.   3.1.1 of the XFree86 version of the X Window System (X11R6) for Linux
  7.   systems. It is a step-by-step guide to configuring XFree86 on your
  8.   system.
  9.  
  10.   1.  Introduction
  11.  
  12.   The X Window System is a large and powerful (and somewhat complex)
  13.   graphics environment for UNIX systems. The original X Window System
  14.   code was developed at MIT; commercial vendors have since made X the
  15.   industry standard for UNIX platforms. Virtually every UNIX workstation
  16.   in the world runs some variant of the X Window system.
  17.  
  18.   A free port of the MIT X Window System version 11, release 6 (X11R6)
  19.   for 80386/80486/Pentium UNIX systems has been developed by a team of
  20.   programmers originally headed by David Wexelblat (dwex@XFree86.org).
  21.   The release, known as XFree86, is available for System V/386, 386BSD,
  22.   and other x86 UNIX implementations, including Linux. It includes all
  23.   of the required binaries, support files, libraries, and tools.
  24.  
  25.   In this document, we'll give a step-by-step description of how to
  26.   install and configure XFree86 for Linux, but you will have to fill in
  27.   some of the details yourself by reading the documentation released
  28.   with XFree86 itself. (This documentation is discussed below.)
  29.   However, using and customizing the X Window System is far beyond the
  30.   scope of this document---for this purpose you should obtain one of the
  31.   many good books on using the X Window System.
  32.  
  33.   2.  Hardware requirements
  34.  
  35.   As of XFree86 version 3.1.1, released in February 1995, the following
  36.   video chipsets are supported. The documentation included with your
  37.   video adaptor should specify the chipset used. If you are in the
  38.   market for a new video card, or are buying a new machine that comes
  39.   with a video card, have the vendor find out exactly what the make,
  40.   model, and chipset of the video card is. This may require the vendor
  41.   to call technical support on your behalf; in general vendors will be
  42.   happy to do this. Many PC hardware vendors will state that the video
  43.   card is a ``standard SVGA card'' which ``should work'' on your system.
  44.   Explain that your software (mention Linux and XFree86!)  does not
  45.   support all video chipsets and that you must have detailed
  46.   information.
  47.  
  48.   You can also determine your videocard chipset by running the
  49.   SuperProbe program included with the XFree86 distribution.  This is
  50.   covered in more detail below.
  51.  
  52.   The following standard SVGA chipsets are supported:
  53.  
  54.   ╖  Tseng ET3000, ET4000AX, ET4000/W32
  55.  
  56.   ╖  Western Digital/Paradise PVGA1
  57.  
  58.   ╖  Western Digital WD90C00, WD90C10, WD90C11, WD90C24, WD90C30,
  59.      WD90C31, WD90C33
  60.  
  61.   ╖  Genoa GVGA
  62.  
  63.   ╖  Trident TVGA8800CS, TVGA8900B, TVGA8900C, TVGA8900CL, TVGA9000,
  64.      TVGA9000i, TVGA9100B, TVGA9200CX, TVGA9320, TVGA9400CX, TVGA9420
  65.  
  66.   ╖  ATI 18800, 18800-1, 28800-2, 28800-4, 28800-5, 28800-6, 68800-3,
  67.      68800-6, 68800AX, 68800LX, 88800
  68.  
  69.   ╖  NCR 77C22, 77C22E, 77C22E+
  70.  
  71.   ╖  Cirrus Logic CLGD5420, CLGD5422, CLGD5424, CLGD5426, CLGD5428,
  72.      CLGD5429, CLGD5430, CLGD5434, CLGD6205, CLGD6215, CLGD6225,
  73.      CLGD6235, CLGD6420
  74.  
  75.   ╖  Compaq AVGA
  76.  
  77.   ╖  OAK OTI067, OTI077
  78.  
  79.   ╖  Avance Logic AL2101
  80.  
  81.   ╖  MX MX68000, MX680010
  82.  
  83.   ╖  Video 7/Headland Technologies HT216-32
  84.  
  85.   The following SVGA chipsets with accelerated features are also
  86.   supported:
  87.  
  88.   ╖  8514/A (and true clones)
  89.  
  90.   ╖  ATI Mach8, Mach32
  91.  
  92.   ╖  Cirrus CLGD5420, CLGD5422, CLGD5424, CLGD5426, CLGD5428, CLGD5429,
  93.      CLGD5430, CLGD5434, CLGD6205, CLGD6215, CLGD6225, CLGD6235
  94.  
  95.   ╖  S3 86C911, 86C924, 86C801, 86C805, 86C805i, 86C928, 86C864, 86C964
  96.  
  97.   ╖  Western Digital WD90C31, WD90C33
  98.  
  99.   ╖  Weitek P9000
  100.  
  101.   ╖  IIT AGX-014, AGX-015, AGX-016
  102.  
  103.   ╖  Tseng ET4000/W32, ET4000/W32i, ET4000/W32p
  104.  
  105.   Video cards using these chipsets are supported on all bus types,
  106.   including VLB and PCI.
  107.  
  108.   All of the above are supported in both 256 color and monochrome modes,
  109.   with the exception of the Avance Logic, MX and Video 7 chipsets, which
  110.   are only supported in 256 color mode. If your video card has enough
  111.   DRAM installed, many of the above chipsets are supported in 16 and 32
  112.   bits-per-pixel mode (specifically, some Mach32, P9000, S3 and Cirrus
  113.   boards). The usual configuration is 8 bits per pixel (that is, 256
  114.   colors).
  115.  
  116.   The monochrome server also supports generic VGA cards, the Hercules
  117.   monochrome card, the Hyundai HGC1280, Sigma LaserView, and Apollo
  118.   monochrome cards. On the Compaq AVGA, only 64k of video memory is
  119.   supported for the monochrome server, and the GVGA has not been tested
  120.   with more than 64k.
  121.  
  122.   This list will undoubtedly expand as time passes. The release notes
  123.   for the current version of XFree86 should contain the complete list of
  124.   supported video chipsets.
  125.  
  126.   One problem faced by the XFree86 developers is that some video card
  127.   manufacturers use non-standard mechanisms for determining clock
  128.   frequencies used to drive the card. Some of these manufacturers either
  129.   don't release specifications describing how to program the card, or
  130.   they require developers to sign a non-disclosure statement to obtain
  131.   the information. This would obviously restrict the free distribution
  132.   of the XFree86 software, something that the XFree86 development team
  133.   is not willing to do. For a long time, this has been a problem with
  134.   certain video cards manufactured by Diamond, but as of release 3.1 of
  135.   XFree86, Diamond has started to work with the development team to
  136.   release free drivers for these cards.
  137.  
  138.   The suggested setup for XFree86 under Linux is a 486 machine with at
  139.   least 8 megabytes of RAM, and a video card with a chipset listed
  140.   above. For optimal performance, we suggest using an accelerated card,
  141.   such as an S3-chipset card. You should check the documentation for
  142.   XFree86 and verify that your particular card is supported before
  143.   taking the plunge and purchasing expensive hardware. Benchmark ratings
  144.   comparisons for various video cards under XFree86 are posted routinely
  145.   to the USENET newsgroups comp.windows.x.i386unix and comp.os.linux.x.
  146.  
  147.   As a side note, my personal Linux system is a 486DX2-66, 20 megabytes
  148.   of RAM, and is equipped with a VLB S3-864 chipset card with 2
  149.   megabytes of DRAM.  I have run X benchmarks on this machine as well as
  150.   on Sun Sparc IPX workstations. The Linux system is roughly 7 times
  151.   faster than the Sparc IPX (for the curious, XFree86-3.1 under Linux,
  152.   with this video card, runs at around 171,000 xstones; the Sparc IPX at
  153.   around 24,000). In general, XFree86 on a Linux system with an
  154.   accelerated SVGA card will give you much greater performance than that
  155.   found on commercial UNIX workstations (which usually employ simple
  156.   framebuffers for graphics).
  157.  
  158.   Your machine will need at least 4 megabytes of physical RAM, and 16
  159.   megabytes of virtual RAM (for example, 8 megs physical and 8 megs
  160.   swap).  Remember that the more physical RAM that you have, the less
  161.   that the system will swap to and from disk when memory is low. Because
  162.   swapping is inherently slow (disks are very slow compared to memory),
  163.   having 8 megabytes of RAM or more is necessary to run XFree86
  164.   comfortably.  A system with 4 megabytes of physical RAM could run much
  165.   (up to 10 times) more slowly than one with 8 megs or more.
  166.  
  167.   3.  Installing XFree86
  168.  
  169.   The Linux binary distribution of XFree86 can be found on a number of
  170.   FTP sites. On sunsite.unc.edu, it is found in the directory
  171.   /pub/Linux/X11. (As of the time of this writing, the current version
  172.   is 3.1.1; newer versions are released periodically).
  173.  
  174.   It's quite likely that you obtained XFree86 as part of a Linux
  175.   distribution, in which case downloading the software separately is not
  176.   necessary.
  177.  
  178.   If you are downloading XFree86 directly, This table lists the files in
  179.   the XFree86-3.1 distribution.
  180.  
  181.   One of the following servers is required:
  182.  
  183.      XF86-3.1.1-8514.tar.gz
  184.         Server for 8514-based boards.
  185.  
  186.      XF86-3.1.1-AGX.tar.gz
  187.         Server for AGX-based boards.
  188.  
  189.      XF86-3.1.1-Mach32.tar.gz
  190.         Server for Mach32-based boards.
  191.  
  192.      XF86-3.1.1-Mach8.tar.gz
  193.         Server for Mach8-based boards.
  194.  
  195.      XF86-3.1.1-Mono.tar.gz
  196.         Server for monochrome video modes.
  197.      XF86-3.1.1-P9000.tar.gz
  198.         Server for P9000-based boards.
  199.  
  200.      XF86-3.1.1-S3.tar.gz
  201.         Server for S3-based boards.
  202.  
  203.      XF86-3.1.1-SVGA.tar.gz
  204.         Server for Super VGA-based boards.
  205.  
  206.      XF86-3.1.1-VGA16.tar.gz
  207.         Server for VGA/EGA-based boards.
  208.  
  209.      XF86-3.1.1-W32.tar.gz
  210.         Server for ET4000/W32-based boards.
  211.  
  212.   All of the following files are required:
  213.  
  214.      XF86-3.1.1-bin.tar.gz
  215.         The rest of the X11R6 binaries.
  216.  
  217.      XF86-3.1.1-cfg.tar.gz
  218.         Config files for xdm, xinit and fs.
  219.  
  220.      XF86-3.1.1-doc.tar.gz
  221.         Documentation and manpages.
  222.  
  223.      XF86-3.1.1-inc.tar.gz
  224.         Include files.
  225.  
  226.      XF86-3.1.1-lib.tar.gz
  227.         Shared X libraries and support files.
  228.  
  229.      XF86-3.1-fnt.tar.gz
  230.         Basic fonts.
  231.  
  232.   The following files are optional:
  233.  
  234.      XF86-3.1-ctrb.tar.gz
  235.         Selected contrib programs.
  236.  
  237.      XF86-3.1-extra.tar.gz
  238.         Extra XFree86 servers and binaries.
  239.  
  240.      XF86-3.1-lkit.tar.gz
  241.         Server linkkit for customization.
  242.  
  243.      XF86-3.1-fnt75.tar.gz
  244.         75-dpi screen fonts.
  245.  
  246.      XF86-3.1-fnt100.tar.gz
  247.         100-dpi screen fonts.
  248.  
  249.      XF86-3.1-fntbig.tar.gz
  250.         Large Kanji and other fonts.
  251.  
  252.      XF86-3.1-fntscl.tar.gz
  253.         Scaled fonts (Speedo, Type1).
  254.  
  255.      XF86-3.1-man.tar.gz
  256.         Manual pages.
  257.  
  258.      XF86-3.1-pex.tar.gz
  259.         PEX binaries, includes and libraries.
  260.  
  261.      XF86-3.1-slib.tar.gz
  262.         Static X libraries and support files.
  263.      XF86-3.1-usrbin.tar.gz
  264.         Daemons which reside in /usr/bin.
  265.  
  266.      XF86-3.1-xdmshdw.tar.gz
  267.         Shadow password version of xdm.
  268.  
  269.   The XFree86 directory should contain README files and installation
  270.   notes for the current version.
  271.  
  272.   All that is required to install XFree86 is to obtain the above files,
  273.   create the directory /usr/X11R6 (as root), and unpack the files from
  274.   /usr/X11R6 with a command such as:
  275.  
  276.        gzip -dc XF86-3.1.1-bin.tar.gz | tar xfB -
  277.  
  278.   Remember that these tar files are packed relative to /usr/X11R6.  so
  279.   it's important to unpack the files there.
  280.  
  281.   After unpacking the files, you first need to link the file
  282.   /usr/X11R6/bin/X to the server that you're using. For example, if you
  283.   wish to use the SVGA color server, /usr/bin/X11/X should be linked to
  284.   /usr/X11R6/bin/XF86_SVGA. If you wish to use the monochrome server
  285.   instead, relink this file to XF86_MONO with the command
  286.  
  287.        ln -sf /usr/X11R6/bin/XF86_MONO /usr/X11R6/bin/X
  288.  
  289.   The same holds true if you are using one of the other servers.
  290.  
  291.   If you aren't sure which server to use, or don't know your video card
  292.   chipset, you can run the SuperProbe program found in /usr/X11R6/bin
  293.   (included in the XF86-3.1-bin listed above).  This program will
  294.   attempt to determine your video chipset type and other information;
  295.   write down its output for later reference.
  296.  
  297.   You need to make sure that /usr/X11R6/bin is on your path.  This can
  298.   be done by editing your system default /etc/profile or /etc/csh.login
  299.   (based on the shell that you, or other users on your system, use). Or
  300.   you can simply add the directory to your personal path by modifying
  301.   /etc/.bashrc or /etc/.cshrc, based on your shell.
  302.  
  303.   You also need to make sure that /usr/X11R6/lib can be located by
  304.   ld.so, the runtime linker. To do this, add the line
  305.  
  306.        /usr/X11R6/lib
  307.  
  308.   to the file /etc/ld.so.conf, and run /sbin/ldconfig, as root.
  309.  
  310.   4.  Configuring XFree86
  311.  
  312.   Setting up XFree86 is not difficult in most cases. However, if you
  313.   happen to be using hardware for which drivers ar under development, or
  314.   wish to obtain the best performance or resolution from an accelerated
  315.   graphics card, configuring XFree86 can be somewhat time-consuming.
  316.   In this section we will describe how to create and edit the XF86Config
  317.   file, which configures the XFree86 server. In many cases it is best to
  318.   start out with a ``basic'' XFree86 configuration, one which uses a low
  319.   resolution, such as 640x480, which should be supported on all video
  320.   cards and monitor types. Once you have XFree86 working at a lower,
  321.   standard resolution, you can tweak the configuration to exploit the
  322.   capabilities of your video hardware. The idea is that you want to know
  323.   that XFree86 works at all on your system, and that something isn't
  324.   wrong with your installation, before attempting the sometimes
  325.   difficult task of setting up XFree86 for real use.
  326.  
  327.   In addition to the information listed here, you should read the
  328.   following documentation:
  329.  
  330.   ╖  The XFree86 documentation in /usr/X11R6/lib/X11/doc (contained
  331.      within the XFree86-3.1-doc package). You should especially see the
  332.      file README.Config, which is an XFree86 configuration tutorial.
  333.  
  334.   ╖  Several video chipsets have separate README files in the above
  335.      directory (such as README.Cirrus and README.S3).  Read one of these
  336.      if applicable.
  337.  
  338.   ╖  The man page for XFree86.
  339.  
  340.   ╖  The man page for XF86Config.
  341.  
  342.   ╖  The man page for the particular server that you are using (such as
  343.      XF86_SVGA or XF86_S3).
  344.  
  345.   The main XFree86 configuration file is /usr/X11R6/lib/X11/XF86Config.
  346.   This file contains information on your mouse, video card parameters,
  347.   and so on. The file XF86Config.eg is provided with the XFree86
  348.   distribution as an example. Copy this file to XF86Config and edit it
  349.   as a starting point.
  350.  
  351.   The XF86Config man page explains the format of this file in detail.
  352.   Read this man page now, if you have not done so already.
  353.  
  354.   We are going to present a sample XF86Config file, piece by piece.
  355.   This file may not look exactly like the sample file included in the
  356.   XFree86 distribution, but the structure is the same.
  357.  
  358.   Note that the XF86Config file format may change with each version of
  359.   XFree86; this information is only valid for XFree86 version 3.1.
  360.  
  361.   Also, you should not simply copy the configuration file listed here to
  362.   your own system and attempt to use it. Attempting to use a
  363.   configuration file which doesn't correspond to your hardware could
  364.   drive the monitor at a frequency which is too high for it; there have
  365.   been reports of monitors (especially fixed-frequency monitors) being
  366.   damaged or destroyed by using an incorrectly configured XF86Config
  367.   file. The bottom line is this: Make absolutely sure that your
  368.   XF86Config file corresponds to your hardware before you attempt to use
  369.   it.
  370.  
  371.   Each section of the XF86Config file is surrounded by the pair of lines
  372.  
  373.        Section "section-name"
  374.          ...
  375.        EndSection
  376.  
  377.   The first part of the XF86Config file is Files, which looks like this:
  378.        Section "Files"
  379.            RgbPath     "/usr/X11R6/lib/X11/rgb"
  380.            FontPath    "/usr/X11R6/lib/X11/fonts/misc/"
  381.            FontPath    "/usr/X11R6/lib/X11/fonts/75dpi/"
  382.        EndSection
  383.  
  384.   The RgbPath line sets the path to the X11R6 RGB color database, and
  385.   each FontPath line sets the path to a directory containing X11 fonts.
  386.   In general you shouldn't have to modify these lines; just be sure that
  387.   there is a FontPath entry for each font type that you have installed
  388.   (that is, for each directory in /usr/X11R6/lib/X11/fonts).
  389.  
  390.   The next section is ServerFlags, which specifies several global flags
  391.   for the server. In general this section is empty.
  392.  
  393.        Section "ServerFlags"
  394.        # Uncomment this to cause a core dump at the spot where a signal is
  395.        # received.  This may leave the console in an unusable state, but may
  396.        # provide a better stack trace in the core dump to aid in debugging
  397.        #    NoTrapSignals
  398.  
  399.        # Uncomment this to disable the <Crtl><Alt><BS> server abort sequence
  400.        #    DontZap
  401.        EndSection
  402.  
  403.   Here, we have all lines within the section commented out.
  404.  
  405.   The next section is Keyboard. This should be fairly intuitive.
  406.  
  407.        Section "Keyboard"
  408.            Protocol    "Standard"
  409.            AutoRepeat  500 5
  410.            ServerNumLock
  411.        EndSection
  412.  
  413.   Other options are available as well---see the XF86Config file if you
  414.   wish to modify the keyboard configuration. The above should work for
  415.   most systems.
  416.  
  417.   The next section is Pointer which specifies parameters for the mouse
  418.   device.
  419.  
  420.   Section "Pointer"
  421.  
  422.       Protocol    "MouseSystems"
  423.       Device      "/dev/mouse"
  424.  
  425.   # Baudrate and SampleRate are only for some Logitech mice
  426.   #    BaudRate   9600
  427.   #    SampleRate 150
  428.  
  429.   # Emulate3Buttons is an option for 2-button Microsoft mice
  430.   #    Emulate3Buttons
  431.  
  432.   # ChordMiddle is an option for some 3-button Logitech mice
  433.   #    ChordMiddle
  434.  
  435.   EndSection
  436.  
  437.   The only options that you should concern yourself with now are Proto¡
  438.   col and Device. Protocol specifies the mouse protocol that your mouse
  439.   uses (not the make or brand of mouse). Valid types for Protocol (under
  440.   Linux---there are other options available for other operating systems)
  441.   are:
  442.  
  443.   ╖  BusMouse
  444.  
  445.   ╖  Logitech
  446.  
  447.   ╖  Microsoft
  448.  
  449.   ╖  MMSeries
  450.  
  451.   ╖  Mouseman
  452.  
  453.   ╖  MouseSystems
  454.  
  455.   ╖  PS/2
  456.  
  457.   ╖  MMHitTab
  458.  
  459.      BusMouse should be used for the Logitech busmouse. Note that older
  460.      Logitech mice should use Logitech, but newer Logitech mice use
  461.      either Microsoft or Mouseman protocols.  This is a case in which
  462.      the protocol doesn't necessarily have anything to do with the make
  463.      of the mouse.
  464.  
  465.   Device specifies the device file where the mouse can be accessed. On
  466.   most Linux systems, this is /dev/mouse.  /dev/mouse is usually a link
  467.   to the appropriate serial port (such as /dev/cua0) for serial mice, or
  468.   to the appropriate busmouse device for busmice. At any rate, be sure
  469.   that the device file listed in Device exists.
  470.  
  471.   The next section is Monitor, which specifies the characteristics of
  472.   your monitor. As with other sections in the XF86Config file, there may
  473.   be more than one Monitor section. This is useful if you have multiple
  474.   monitors connected to a system, or use the same XF86Config file under
  475.   multiple hardware configurations.  In general, though, you will need a
  476.   single Monitor section.
  477.  
  478.   Section "Monitor"
  479.  
  480.       Identifier  "CTX 5468 NI"
  481.  
  482.       # These values are for a CTX 5468NI only! Don't attempt to use
  483.       # them with your monitor (unless you have this model)
  484.  
  485.       Bandwidth    60
  486.       HorizSync    30-38,47-50
  487.       VertRefresh  50-90
  488.  
  489.       # Modes: Name      dotclock  horiz                vert
  490.  
  491.       ModeLine "640x480"  25       640 664 760 800      480 491 493 525
  492.       ModeLine "800x600"  36       800 824 896 1024     600 601 603 625
  493.       ModeLine "1024x768" 65       1024 1088 1200 1328  768 783 789 818
  494.  
  495.   EndSection
  496.  
  497.   The Identifier line is used to give an arbitrary name to the Monitor
  498.   entry. This can be any string; you will use it to refer to the Monitor
  499.   entry later in the XF86Config file.
  500.  
  501.   they are listed below.
  502.  
  503.   HorizSync specifies the valid horizontal sync frequencies for your
  504.   monitor, in kHz. If you have a multisync monitor, this can be a range
  505.   of values (or several comma-separated ranges), as seen above.  If you
  506.   have a fixed-frequency monitor, this will be a list of discrete
  507.   values, such as:
  508.  
  509.            HorizSync    31.5, 35.2, 37.9, 35.5, 48.95
  510.  
  511.   Your monitor manual should list these values in the technical specifi¡
  512.   cations section. If you do not have this information available, you
  513.   should either contact the manufacturer or vendor of your monitor to
  514.   obtain it. There are other sources of information, as well;
  515.  
  516.   VertRefresh specifies the valid vertical refresh rates (or vertical
  517.   synchronization frequencies) for your monitor, in Hz.  Like HorizSync
  518.   this can be a range or a list of discrete values; your monitor manual
  519.   should list them.
  520.  
  521.   HorizSync and VertRefresh are used only to double-check that the
  522.   monitor resolutions that you specify are in valid ranges. This is to
  523.   reduce the chance that you will damage your monitor by attempting to
  524.   drive it at a frequency for which it was not designed.
  525.  
  526.   The ModeLine directive is used to specify a single resolution mode for
  527.   your monitor. The format of ModeLine is
  528.  
  529.        ModeLine name clock horiz-values vert-values
  530.  
  531.   name is an arbitrary string, which you will use to refer to the reso¡
  532.   lution mode later in the file. dot-clock is the driving clock
  533.   frequency, or ``dot clock'' associated with the resolution mode.  A
  534.   dot clock is usually specified in MHz, and is the rate at which the
  535.   video card must send pixels to the monitor at this resolution.  horiz-
  536.   values and vert-values are four numbers each which specify when the
  537.   electron gun of the monitor should fire, and when the horizontal and
  538.   vertical sync pulses fire during a sweep.
  539.  
  540.   How can you determine the ModeLine values for your monitor?  The file
  541.   VideoModes.doc, included with the XFree86 distribution, describes in
  542.   detail how to determine these values for each resolution mode that
  543.   your monitor supports. First of all, clock must correspond to one of
  544.   the dot clock values that your video card can produce. Later in the
  545.   XF86Config file you will specify these clocks; you can only use video
  546.   modes which have a clock value supported by your video card.
  547.  
  548.   There are two files included in the XFree86 distribution which may
  549.   include ModeLine data for your monitor. These files are modeDB.txt and
  550.   Monitors, both of which are found in /usr/X11R6/lib/X11/doc.
  551.  
  552.   You should start with ModeLine values for the VESA standard monitor
  553.   timings, which most monitors support. modeDB.txt includes timing
  554.   values for VESA standard resolutions. In that file, you will see
  555.   entries such as
  556.  
  557.        # 640x480@60Hz Non-Interlaced mode
  558.        # Horizontal Sync = 31.5kHz
  559.        # Timing: H=(0.95us, 3.81us, 1.59us), V=(0.35ms, 0.064ms, 1.02ms)
  560.        #
  561.        # name        clock   horizontal timing     vertical timing      flags
  562.         "640x480"     25.175  640  664  760  800    480  491  493  525
  563.  
  564.   This is a VESA standard timing for a 640x480 video mode. It uses a dot
  565.   clock of 25.175, which your video card must support to use this mode
  566.   (more on this later). To include this entry in the XF86Config file,
  567.   you'd use the line
  568.  
  569.        ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525
  570.  
  571.   Note that the name argument to ModeLine (in this case "640x480") is an
  572.   arbitrary string---the convention is to name the mode after the reso¡
  573.   lution, but name can technically be anything descriptive which
  574.   describes the mode to you.
  575.  
  576.   For each ModeLine used the server will check that the specifications
  577.   for the mode fall within the range of values specified with Bandwidth,
  578.   HorizSync and VertRefresh. If they do not, the server will complain
  579.   when you attempt to start up X (more on this later). For one thing,
  580.   the dot clock used by the mode should not be greater than the value
  581.   used for Bandwidth. (However, in many cases it is safe to use modes
  582.   with a slightly higher bandwidth than your monitor can support.)
  583.  
  584.   If the VESA standard timings do not work for you (you'll know after
  585.   trying to use them later) then the files modeDB.txt and Monitors
  586.   include specific mode values for many monitor types.  You can create
  587.   ModeLine entries from the values found in those two files as well. Be
  588.   sure to only use values for the specific model of monitor that you
  589.   have. Note that many 14 and 15-inch monitors cannot support higher
  590.   resolution modes, and often resolutions of 1024x768 at low dot clocks.
  591.   This means that if you can't find high resolution modes for your
  592.   monitor in these files, then your monitor probably does not support
  593.   those resolution modes.
  594.  
  595.   If you are completely at a loss, and can't find working ModeLine
  596.   values for your monitor, you can follow the instructions in the
  597.   VideoModes.doc file included in the XFree86 distribution to generate
  598.   ModeLine values from the specifications listed in your monitor's
  599.   manual. While your mileage will certainly vary when attempting to
  600.   generate ModeLine values by hand, this is a good place to look if you
  601.   can't find the values that you need. VideoModes.doc also describes the
  602.   format of the ModeLine directive and other aspects of the XFree86
  603.   server in gory detail.
  604.  
  605.   Lastly, if you do obtain ModeLine values which are almost, but not
  606.   quite, right, then it may be possible to simply modify the values
  607.   slightly to obtain the desired result. For example, if while running
  608.   XFree86 the image on the monitor is shifted slightly, or seems to
  609.   ``roll'', you can follow the instructions in the VideoModes.doc file
  610.   to try to fix these values. Also, be sure to check the knobs and
  611.   controls on the monitor itself! In many cases it is necessary to
  612.   change the horizontal or vertical size of the display after starting
  613.   up XFree86 in order for the image to be centered and be of the
  614.   appropriate size. Having these controls on the front of the monitor
  615.   can certainly make life easier.
  616.  
  617.   You shouldn't use monitor timing values or ModeLine values for
  618.   monitors other than the model that you own. If you attempt to drive
  619.   the monitor at a frequency for which it was not designed, you can
  620.   damage or even destroy it.
  621.  
  622.   The next section of the XF86Config file is Device, which specifies
  623.   parameters for your video card. Here is an example.
  624.  
  625.        Section "Device"
  626.                Identifier "#9 GXE 64"
  627.  
  628.                # Nothing yet; we fill in these values later.
  629.  
  630.        EndSection
  631.  
  632.   This section defines properties for a particular video card.
  633.   Identifier is an arbitrary string describing the card; you will use
  634.   this string to refer to the card later.
  635.  
  636.   Initially, you don't need to include anything in the Device section,
  637.   except for Identifier. This is because we will be using the X server
  638.   itself to probe for the properties of the video card, and entering
  639.   them into the Device section later.  The XFree86 server is capable of
  640.   probing for the video chipset, clocks, RAMDAC, and amount of video RAM
  641.   on the board.
  642.  
  643.   Before we do this, however, we need to finish writing the XF86Config
  644.   file. The next section is Screen, which specifies the monitor/video
  645.   card combination to use for a particular server.
  646.  
  647.    Section "Screen"
  648.        Driver     "Accel"
  649.        Device     "#9 GXE 64"
  650.        Monitor    "CTX 5468 NI"
  651.        Subsection "Display"
  652.            Depth      16
  653.            Modes      "1024x768" "800x600" "640x480"
  654.            ViewPort   0 0
  655.            Virtual    1024 768
  656.        EndSubsection
  657.    EndSection
  658.  
  659.   The Driver line specifies the X server that you will be using.  The
  660.   value values for Driver are:
  661.  
  662.   ╖  Accel: For the XF86_S3, XF86_Mach32, XF86_Mach8, XF86_8514,
  663.      XF86_P9000, XF86_AGX, and XF86_W32 servers;
  664.  
  665.   ╖  SVGA: For the XF86_SVGA server;
  666.  
  667.   ╖  VGA16: For the XF86_VGA16 server;
  668.  
  669.   ╖  VGA2: For the XF86_Mono server;
  670.  
  671.   ╖  Mono: For the non-VGA monochrome drivers in the XF86_Mono and
  672.      XF86_VGA16 servers.
  673.  
  674.      You should be sure that /usr/X11R6/bin/X is a symbolic link to the
  675.      server that you are using.
  676.  
  677.   The Device line specifies the Identifier of the Device section
  678.   corresponding to the video card to use for this server.  Above, we
  679.   created a Device section with the line
  680.  
  681.        Identifier "#9 GXE 64"
  682.  
  683.   Therefore, we use "#9 GXE 64" on the Device line here.
  684.  
  685.   Similarly, the Monitor line specifies the name of the Monitor section
  686.   to be used with this server. Here, "CTX 5468 NI" is the Identifier
  687.   used in the Monitor section described above.
  688.  
  689.   Subsection "Display" defines several properties of the XFree86 server
  690.   corresponding to your monitor/video card combination.  The XF86Config
  691.   file describes all of these options in detail; most of them are icing
  692.   on the cake and not necessary to get the system working.
  693.  
  694.   The options that you should know about are:
  695.  
  696.   ╖  Depth. Defines the number of color planes---the number of bits per
  697.      pixel. Usually, Depth is set to 8. For the VGA16 server, you would
  698.      use a depth of 4, and for the monochrome server a depth of 1. If
  699.      you are using an accelerated video card with enough memory to
  700.      support more bits per pixel, you can set Depth to 16, 24, or 32.
  701.      If you have problems with depths higher than 8, set it back to 8
  702.      and attempt to debug the problem later.
  703.  
  704.   ╖  Modes. This is the list of video mode names which have been defined
  705.      using the ModeLine directive in the Monitor section. In the above
  706.      section, we used ModeLines named "1024x768", "800x600", and
  707.      "640x480".  Therefore, we use a Modes line of
  708.  
  709.                 Modes    "1024x768" "800x600" "640x480"
  710.  
  711.   The first mode listed on this line will be the default when XFree86
  712.   starts up. After XFree86 is running, you can switch between the modes
  713.   listed here using the keys ctrl-alt-numeric + and ctrl-alt-numeric -.
  714.  
  715.   It might be best, when initially configuring XFree86, to use lower
  716.   resolution video modes, such as 640x480, which tend to work on most
  717.   systems. Once you have the basic configuration working you can modify
  718.   XF86Config to support higher resolutions.
  719.  
  720.   ╖  Virtual. Sets the virtual desktop size. XFree86 has the ability to
  721.      use any additional memory on your video card to extend the size of
  722.      your desktop. When you move the mouse pointer to the edge of the
  723.      display, the desktop will scroll, bringing the additional space
  724.      into view. Therefore, even if you are running at a lower video
  725.      resolution such as 800x600, you can set Virtual to the total
  726.      resolution which your video card can support (a 1-megabyte video
  727.      card can support 1024x768 at a depth of 8 bits per pixel; a
  728.      2-megabyte card 1280x1024 at depth 8, or 1024x768 at depth 16).  Of
  729.      course, the entire area will not be visible at once, but it can
  730.      still be used.
  731.  
  732.      The Virtual feature is a nice way to utilize the memory of your
  733.      video card, but it is rather limited. If you want to use a true
  734.      virtual desktop, we suggest using fvwm, or a similar window
  735.      manager, instead. fvwm allows you to have rather large virtual
  736.      desktops (implemented by hiding windows, and so forth, instead of
  737.      actually storing the entire desktop in video memory at once). See
  738.      the man pages for fvwm for more details about this; most Linux
  739.      systems use fvwm by default.
  740.  
  741.   ╖  ViewPort. If you are using the Virtual option described above,
  742.      ViewPort sets the coordinates of the upper-left-hand corner of the
  743.      virtual desktop when XFree86 starts up. Virtual 0 0 is often used;
  744.      if this is unspecified then the desktop is centered on the virtual
  745.      desktop display (which may be undesirable to you).
  746.  
  747.   Many other options for this section exist; see the XF86Config man page
  748.   for a complete description. In practice these other options are not
  749.   necessary to get XFree86 initially working.
  750.  
  751.   5.  Filling in video card information
  752.  
  753.   Your XF86Config file is now ready to go, with the exception of
  754.   complete information on the video card. What we're going to do is use
  755.   the X server to probe for the rest of this information, and fill it
  756.   into XF86Config.
  757.  
  758.   Instead of probing for this information with the X server, the
  759.   XF86Config values for many cards are listed in the files modeDB.txt,
  760.   AccelCards, and Devices. These files are all found in
  761.   /usr/X11R6/lib/X11/doc. In addition, there are various README files
  762.   for certain chipsets. You should look in these files for information
  763.   on your video card, and use that information (the clock values,
  764.   chipset type, and any options) in the XF86Config file. If any
  765.   information is missing, you can probe for it as described here.
  766.  
  767.   In these examples we will demonstrate configuration for a #9 GXE 64
  768.   video card, which uses the XF86_S3 chipset.  This card happens to be
  769.   the one which the author uses, but the discussion here applies to any
  770.   video card.
  771.  
  772.   The first thing to do is to determine the video chipset used on the
  773.   card.  Running SuperProbe (found in /usr/X11R6/bin) will tell you this
  774.   information, but you need to know the chipset name as it is known to
  775.   the X server.
  776.  
  777.   To do this, run the command
  778.  
  779.        X -showconfig
  780.  
  781.   This will give the chipset names known to your X server. (The man
  782.   pages for each X server list these as well.)  For example, with the
  783.   accelerated XF86_S3 server, we obtain:
  784.  
  785.        XFree86 Version 3.1 / X Window System
  786.        (protocol Version 11, revision 0, vendor release 6000)
  787.        Operating System: Linux
  788.        Configured drivers:
  789.          S3: accelerated server for S3 graphics adaptors (Patchlevel 0)
  790.              mmio_928, s3_generic
  791.  
  792.   The valid chipset names for this server are mmio_928 and s3_generic.
  793.   The XF86_S3 man page describes these chipsets and which videocards use
  794.   them. In the case of the #9 GXE 64 video card, mmio_928 is
  795.   appropriate.
  796.  
  797.   If you don't know which chipset to use, the X server can probe it for
  798.   you. To do this, run the command
  799.  
  800.        X -probeonly > /tmp/x.out 2>&1
  801.  
  802.   if you use bash as your shell. If you use csh, try:
  803.  
  804.        X -probeonly &> /tmp/x.out
  805.  
  806.   You should run this command while the system is unloaded, that is,
  807.   while no other activity is occurring on the system. This command will
  808.   also probe for your video card dot clocks (as seen below), and system
  809.   load can throw off this calculation.
  810.  
  811.   The output from the above (in /tmp/x.out should contain lines such as
  812.   the following:
  813.  
  814.   XFree86 Version 3.1 / X Window System
  815.   (protocol Version 11, revision 0, vendor release 6000)
  816.   Operating System: Linux
  817.   Configured drivers:
  818.     S3: accelerated server for S3 graphics adaptors (Patchlevel 0)
  819.         mmio_928, s3_generic
  820.      ...
  821.   (--) S3: card type: 386/486 localbus
  822.   (--) S3: chipset:   864 rev. 0
  823.   (--) S3: chipset driver: mmio_928
  824.  
  825.   Here, we see that the two valid chipsets for this server (in this
  826.   case, XF86_S3) are mmio_928 and s3_generic. The server probed for and
  827.   found a video card using the mmio_928 chipset.
  828.  
  829.   In the Device section of the XF86Config file, add a Chipset line,
  830.   containing the name of the chipset as determined above. For example,
  831.  
  832.        Section "Device"
  833.                # We already had Identifier here...
  834.                Identifier "#9 GXE 64"
  835.                # Add this line:
  836.                Chipset "mmio_928"
  837.        EndSection
  838.  
  839.   Now we need to determine the driving clock frequencies used by the
  840.   video card.  A driving clock frequency, or dot clock, is simply a rate
  841.   at which the video card can send pixels to the monitor. As we have
  842.   seen, each monitor resolution has a dot clock associated with it. Now
  843.   we need to determine which dot clocks are made available by the video
  844.   card.
  845.  
  846.   First you should look into the files (modeDB.txt, and so forth)
  847.   mentioned above and see if your card's clocks are listed there.  The
  848.   dot clocks will usually be a list of 8 or 16 values, all of which are
  849.   in MHz. For example, when looking at modeDB.txt we see an entry for
  850.   the Cardinal ET4000 video board, which looks like this:
  851.  
  852.        # chip    ram   virtual   clocks                           default-mode  flags
  853.         ET4000   1024  1024 768   25  28  38  36  40  45  32   0  "1024x768"
  854.  
  855.   As we can see, the dot clocks for this card are 25, 28, 38, 36, 40,
  856.   45, 32, and 0 MHz.
  857.  
  858.   In the Devices section of the XF86Config file, you should add a Clocks
  859.   line containing the list of dot clocks for your card.  For example,
  860.   for the clocks above, we would add the line
  861.  
  862.                Clocks 25 28 38 36 40 45 32 0
  863.  
  864.   to the Devices section of the file, after Chipset.  Note that the
  865.   order of the clocks is important! Don't resort the list of clocks or
  866.   remove duplicates.
  867.  
  868.   If you cannot find the dot clocks associated with your card, the X
  869.   server can probe for these as well. Using the X -probeonly command
  870.   described above, the output should contain lines which look like the
  871.   following:
  872.  
  873.        (--) S3: clocks:  25.18  28.32  38.02  36.15  40.33  45.32  32.00  00.00
  874.  
  875.   We could then add a Clocks line containing all of these values, as
  876.   printed. You can use more than one Clocks line in XF86Config should
  877.   all of the values (sometimes there are more than 8 clock values
  878.   printed) not fit onto one line. Again, be sure to keep the list of
  879.   clocks in order as they are printed.
  880.  
  881.   Be sure that there is no Clocks line (or that it is commented out) in
  882.   the Devices section of the file when using X -probeonly to probe for
  883.   the clocks. If there is a Clocks line present, the server will not
  884.   probe for the clocks---it will use the values given in XF86Config.
  885.  
  886.   Note that some accelerated video boards use a programmable clock chip.
  887.   (See the XF86_Accel man page for details; this generally applies to
  888.   S3, AGX, and XGA-2 boards.)  This chip essentially allows the X server
  889.   to tell the card which dot clocks to use. If this is the case, then
  890.   you may not find a list of dot clocks for the card in any of the above
  891.   files. Or, the list of dot clocks printed when using X -probeonly will
  892.   only contain one or two discrete clock values, with the rest being
  893.   duplicates or zero.
  894.  
  895.   For boards which use a programmable clock chip, you would use a
  896.   ClockChip line, instead of a Clocks line, in your XF86Config file.
  897.   ClockChip gives the name of the clock chip as used by the video card;
  898.   the man pages for each server describe what these are. For example, in
  899.   the file README.S3, we see that several S3-864 video cards use an
  900.   ``ICD2061A'' clock chip, and that we should use the line
  901.  
  902.           ClockChip "icd2061a"
  903.  
  904.   instead of Clocks in the XF86Config file. As with Clocks, this line
  905.   should go in the Devices section, after Chipset.
  906.  
  907.   Similarly, some accelerated cards require you to specify the RAMDAC
  908.   chip type in the XF86Config file, using a Ramdac line.  The XF86_Accel
  909.   man page describes this option. Usually, the X server will correctly
  910.   probe for the RAMDAC.
  911.  
  912.   Some video card types require you to specify several options in the
  913.   Devices section of XF86Config. These options will be described in the
  914.   man page for your server, as well as in the various files (such as
  915.   README.cirrus or README.S3. These options are enabled using the Option
  916.   line. For example, the #9 GXE 64 card requires two options:
  917.  
  918.                Option "number_nine"
  919.                Option "dac_8_bit"
  920.  
  921.   Usually, the X server will work without these options, but they are
  922.   necessary to obtain the best performance. There are too many such
  923.   options to list here, and they each depend on the particular video
  924.   card being used. If you must use one of these options, fear not---the
  925.   X server man pages and various files in /usr/X11R6/lib/X11/doc will
  926.   tell you what they are.
  927.  
  928.   So, when you're finished, you should end up with a Devices section
  929.   which looks something like this:
  930.  
  931.        Section "Device"
  932.                # Device section for the #9 GXE 64 only!
  933.                Identifier "#9 GXE 64"
  934.                Chipset "mmio_928"
  935.                ClockChip "icd2061a"
  936.                Option "number_nine"
  937.                Option "dac_8_bit"
  938.        EndSection
  939.  
  940.   Most video cards will require a Clocks line, instead of ClockChip, as
  941.   described above. The above Device entry is only valid for a particular
  942.   video card, the #9 GXE 64. It is given here only as an example.
  943.  
  944.   There are other options that you can include in the Devices entry.
  945.   Check the X server man pages for the gritty details, but the above
  946.   should suffice for most systems.
  947.  
  948.   6.  Running XFree86
  949.  
  950.   With your XF86Config file configured, you're ready to fire up the X
  951.   server and give it a spin. First, be sure that /usr/X11R6/bin is on
  952.   your path.
  953.  
  954.   The command to start up XFree86 is
  955.  
  956.        startx
  957.  
  958.   This is a front-end to xinit (in case you're used to using xinit on
  959.   other UNIX systems).
  960.  
  961.   This command will start the X server and run the commands found in the
  962.   file .xinitrc in your home directory. .xinitrc is just a shell script
  963.   containing X clients to run. If this file does not exist, the system
  964.   default /usr/X11R6/lib/X11/xinit/xinitrc will be used.
  965.  
  966.   A standard .xinitrc file looks like this:
  967.  
  968.        #!/bin/sh
  969.  
  970.        xterm -fn 7x13bold -geometry 80x32+10+50 &
  971.        xterm -fn 9x15bold -geometry 80x34+30-10 &
  972.        oclock -geometry 70x70-7+7 &
  973.        xsetroot -solid midnightblue &
  974.  
  975.        exec twm
  976.  
  977.   This script will start up two xterm clients, an oclock, and set the
  978.   root window (background) color to midnightblue.  It will then start up
  979.   twm, the window manager. Note that twm is executed with the shell's
  980.   exec statement; this causes the xinit process to be replaced with twm.
  981.   Once the twm process exits, the X server will shut down. You can cause
  982.   twm to exit by using the root menus: depress mouse button 1 on the
  983.   desktop background---this will display a pop up menu which will allow
  984.   you to Exit Twm.
  985.  
  986.   Be sure that the last command in .xinitrc is started with exec, and
  987.   that it is not placed into the background (no ampersand on the end of
  988.   the line). Otherwise the X server will shut down as soon as it has
  989.   started the clients in the .xinitrc file.
  990.  
  991.   Alternately, you can exit X by pressing ctrl-alt-backspace in
  992.   combination. This will kill the X server directly, exiting the window
  993.   system.
  994.  
  995.   The above is a very, very simple desktop configuration. Many wonderful
  996.   programs and configurations are available with a bit of work on your
  997.   .xinitrc file.  For example, the fvwm window manager will provide a
  998.   virtual desktop, and you can customize colors, fonts, window sizes and
  999.   positions, and so forth to your heart's content.  Although the X
  1000.   Window System might appear to be simplistic at first, it is extremely
  1001.   powerful once you customize it for yourself.
  1002.  
  1003.   If you are new to the X Window System environment, we strongly suggest
  1004.   picking up a book such as The X Window System: A User's Guide.  Using
  1005.   and configuring X is far too in-depth to cover here. See the man pages
  1006.   for xterm, oclock, and twm for clues on getting started.
  1007.  
  1008.   7.  Running Into Trouble
  1009.  
  1010.   Often, something will not be quite right when you initially fire up
  1011.   the X server. This is almost always caused by a problem in your
  1012.   XF86Config file. Usually, the monitor timing values are off, or the
  1013.   video card dot clocks set incorrectly. If your display seems to roll,
  1014.   or the edges are fuzzy, this is a clear indication that the monitor
  1015.   timing values or dot clocks are wrong. Also be sure that you are
  1016.   correctly specifying your video card chipset, as well as other options
  1017.   for the Device section of XF86Config. Be absolutely certain that you
  1018.   are using the right X server and that /usr/X11R6/bin/X is a symbolic
  1019.   link to this server.
  1020.  
  1021.   If all else fails, try to start X ``bare''; that is, use a command
  1022.   such as:
  1023.  
  1024.        X > /tmp/x.out 2>&1
  1025.  
  1026.   You can then kill the X server (using the ctrl-alt-backspace key com¡
  1027.   bination) and examine the contents of /tmp/x.out. The X server will
  1028.   report any warnings or errors---for example, if your video card
  1029.   doesn't have a dot clock corresponding to a mode supported by your
  1030.   monitor.
  1031.  
  1032.   The file VideoModes.doc included in the XFree86 distribution contains
  1033.   many hints for tweaking the values in your XF86Config file.
  1034.  
  1035.   Remember that you can use ctrl-alt-numeric + and ctrl-alt-numeric - to
  1036.   switch between the video modes listed on the Modes line of the Screen
  1037.   section of XF86Config. If the highest resolution mode doesn't look
  1038.   right, try switching to lower resolutions. This will let you know, at
  1039.   least, that those parts of your X configuration are working correctly.
  1040.  
  1041.   Also, check the vertical and horizontal size/hold knobs on your
  1042.   monitor.  In many cases it is necessary to adjust these when starting
  1043.   up X. For example, if the display seems to be shifted slightly to one
  1044.   side, you can usually correct this using the monitor controls.
  1045.  
  1046.   The USENET newsgroup comp.windows.x.i386unix is devoted to discussions
  1047.   about XFree86, as is comp.os.linux.x.  It might be a good idea to
  1048.   watch that newsgroup for postings relating to your video
  1049.   configuration---you might run across someone with the same problems as
  1050.   your own.
  1051.  
  1052.   8.  Copyright
  1053.  
  1054.   This document is Copyright (c)1995 by Matt Welsh. This work may be
  1055.   reproduced and distributed in whole or in part, in either printed or
  1056.   electronic form, subject to the following conditions:
  1057.  
  1058.   1. The copyright notice and this license notice must be preserved
  1059.      complete on all complete or partial copies.
  1060.  
  1061.   2. Any translation or derivative work must be approved by the author
  1062.      in writing before distribution.
  1063.  
  1064.   3. If you distribute the Work in part, instructions for obtaining a
  1065.      complete version (in printed or electonic form) must be included,
  1066.      and a means for obtaining a complete version provided.
  1067.  
  1068.   4. Small portions may be reproduced as illustrations for reviews or
  1069.      quotes in other works without this permission notice if proper
  1070.      citation is given.
  1071.  
  1072.   Exceptions to these rules may be granted for academic purposes, write
  1073.   to the author of the Work, and ask. These restrictions are here to
  1074.   protect the authors, not to restrict you as educators and learners.
  1075.  
  1076.